package com.my.zl.console.common.constant;

import com.my.zl.common.constants.Constant;
import com.my.zl.common.enums.code.ParamEnum;

/**
 * 
 * @author zhouliang
 *
 */
public class AutocodeC implements Constant {
    
    /** 数据状态*/
    public enum DataStatus implements ParamEnum{
        /**启用*/
        ENABLE("00", ""),
        /**禁用*/
        DISABLE("00", ""),
        /**临时*/
        TEMPORARY("98", ""),
        /**删除*/
        DELETE("99", "11"),
        ;
        private String code;
        private String msg;

        DataStatus(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }
        public String getCode() {
            return code;
        }
        public String getMsg() {
            return msg;
        }
        
        public static String msg(String code) {
            for (DataStatus m : DataStatus.values()) {
                if (m.getCode() == code) {
                    return m.getMsg();
                }
            }
            return null;
        }
    }
    
    /** 实体/实体字段数据来源*/
    public enum EntityFlag implements ParamEnum{
        /**表*/
        SOURCE_TABLE("0", ""),
        /**自定义*/
        SOURCE_CUSTOM("1", ""),
        ;
        private String code;
        private String msg;

        EntityFlag(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }
        public String getCode() {
            return code;
        }
        public String getMsg() {
            return msg;
        }
        
        public static String msg(String code) {
            for (EntityFlag m : EntityFlag.values()) {
                if (m.getCode() == code) {
                    return m.getMsg();
                }
            }
            return null;
        }
    }
}
